//
//  ZZHForTD_AlertView.h
//  AFNetworking
//
//  Created by IDEAL YANG on 2018/5/9.
//

#import <UIKit/UIKit.h>

@protocol ZZHForTD_AlertViewDelegate;

@interface ZZHForTD_AlertView : UIView

@property (strong, nonatomic) UIView *contentView;
@property (strong, nonatomic) UIImage *icon;
@property (strong, nonatomic) NSString *title;
@property (strong, nonatomic) NSString *message;
@property (assign, nonatomic) UIWindowLevel maxSupportedWindowLevel; 
@property (weak, nonatomic) id<ZZHForTD_AlertViewDelegate> delegate;

- (instancetype)initWithTitle:(NSString *)title icon:(UIImage *)icon message:(NSString *)message delegate:(id<ZZHForTD_AlertViewDelegate>)delegate buttonTitles:(NSString *)buttonTitles, ... NS_REQUIRES_NIL_TERMINATION;

// Show the alert view in current window
- (void)show;

// Hide the alert view
- (void)hide;

// Set the color and font size of title, if color is nil, default is black. if fontsize is 0, default is 14
- (void)setTitleColor:(UIColor *)color fontSize:(CGFloat)size;

// Set the color and font size of message, if color is nil, default is black. if fontsize is 0, default is 12
- (void)setMessageColor:(UIColor *)color fontSize:(CGFloat)size;

// Set the color and font size of button at the index, if color is nil, default is black. if fontsize is 0, default is 16
- (void)setButtonTitleColor:(UIColor *)color fontSize:(CGFloat)size atIndex:(NSInteger)index;

@end

/***************
 ** 使用方法
 ** FDAlertView *alert = [[FDAlertView alloc] initWithTitle:@"退出登录" icon:nil message:@"确定退出登录吗？" delegate:self buttonTitles:@"确定", @"取消", nil];
 ** [alert setMessageColor:[UIColor redColor] fontSize:0];
 ** [alert show];
 **
 **
 **
 **
 ** - (void)alertView:(FDAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
 ** NSLog(@"%ld", (long)buttonIndex);
 ** }
 **
 **
 ****/


@protocol ZZHForTD_AlertViewDelegate <NSObject>

- (void)alertView:(ZZHForTD_AlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;

@end
